package 比屋作业.day14;
//Flight类: 航班的编号，起⻜⽇期和时间，降落⽇期和时间，起⻜地点和降落地点。
//使⽤LocalDate和LocalDateTime来记录和显示⼀个航班的日期和时间，以及航班的起⻜和降落地点。
import java.time.LocalDateTime;
public class D14_3 {
    public static void main(String[] args) {
        LocalDateTime depTime=LocalDateTime.parse("2024-01-24T14:30");
        LocalDateTime arrTime= LocalDateTime.parse("2024-01-24T18:30");
            Flight flight=new Flight("CA123",depTime,arrTime,"北京","上海");
            flight.displayFlightInfo();
    }
}
class Flight{
    private String number;
    private LocalDateTime departureTime;
    private LocalDateTime arrivalTime;
    private String departLocation;
    private String arrivalLocation;
    public Flight(String number,LocalDateTime departureTime,LocalDateTime arrivalTime,String departLocation,String arrivalLocation){
        this.number=number;
        this.departureTime=departureTime;
        this.arrivalLocation=arrivalLocation;
        this.arrivalTime=arrivalTime;
        this.departLocation=departLocation;
    }
    public void displayFlightInfo(){
        System.out.println("航班编号："+number);
        System.out.println("起飞时间："+departureTime);
        System.out.println("降落时间："+arrivalTime);
        System.out.println("起飞地点："+departLocation);
        System.out.println("降落地点："+arrivalLocation);
    }



}
